/**
 * Created by oneminute on 7/20/14.
 */

var lz = require("../lib/utils/modules")();
var util = require("util");

var user01 = new lz.User({
    id: "t_001",
    name: "001",
    email: {
        email: "test001@lz.com"
    },
    commodities: [
        {id: "c_0001", description: "c_0001_desc"},
        {id: "c_0002", description: "c_0002_desc"}
    ]
});


user01.save(function () {
    lz.Logger.debug("user01: ", user01);
    var user02 = new lz.User({_id: user01._id});
    lz.Logger.debug("user02: ", user02);
    /*user02.load(function () {
        lz.Logger.info("user02: ", user02);
    });*/
    var user03 = new lz.User({id: user01.id});
    user03.load({loadAll:true, method:"byId"}, function () {
        lz.Logger.info("user03: ", user03);
    });
});


